<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<rapid:override name="frame-content">
    <blockquote class="layui-elem-quote">
        <span class="layui-breadcrumb" lay-separator="/">
              <a href="javascript:void(0)">首页</a>
              <a><cite>评论列表</cite></a>
        </span>
    </blockquote>
    <div class="layui-tab layui-tab-card">
    <table class="layui-table" lay-even lay-skin="nob">
        <colgroup>
            <col width="100">
            <col width="300">
            <col width=200">
            <col width="150">
            <col width="50">
        </colgroup>
        <thead>
        <tr>
            <th>作者</th>
            <th>评论内容</th>
            <th>回复至</th>
            <th>提交于</th>
            <th>ID</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="c" items="${pageInfo.list}">
            <tr>
                <td>
                    <img src="${c.commentAuthorAvatar}" alt="" width="64px">
                    <c:if test="${c.commentRole==1}">[管理员]</c:if>
                    <c:if test="${c.commentRole!=1}">[访客]</c:if>
                    <strong>${c.commentAuthorName}</strong>
                    <br>
                    <br>
                    ${c.commentAuthorEmail}<br>
                    ${c.commentIp}
                </td>
                <td class="dashboard-comment-wrap">
                    <a href="">${c.commentPname}</a>
                    ${c.commentContent}<div class="row-actions">
                                         <span class="">
                                            <a href="comment/reply/${c.commentId}">
                                                回复
                                            </a>
                                         </span>
                    <span class=""> |
                                            <a href="comment/edit/${c.commentId}">编辑</a>
                                         </span>
                    <span class=""> |
                                            <a href="javascript:void(0)" onclick="deleteComment(${c.commentId})">删除</a>
                                         </span>
                </div>
                </td>
                <td>
                    <a href="/article/${c.commentArticleId}"
                       target="_blank">${c.article.articleTitle}</a>
                </td>
                <td>
                    <fmt:formatDate value="${c.commentCreateTime}" pattern="yyyy-MM-dd"/> </td>
                <td>${c.commentId}</td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
        <%@include file="../page.jsp"%>
    </div>
</rapid:override>
<%@include file="../framework.jsp"%>